<?php
/**
 * Created by PhpStorm
 * User: shen.zk
 * Date: 2023/10/23
 * Time: 16:03
 * Comment: ''
 */

namespace App\Repository;

use App\Models\MerchantsAdmin;

class MerchantsAdminRepo extends BaseRepo
{

    /**
     * 新增商户账号信息
     * @param array $data
     * @param int $id
     * @return int
     * @author shen.zk
     * @date 2023-10-23 16:05
     */
    public function save(array $data,int $id = 0)
    {
        if ($id) {
            return MerchantsAdmin::query()->where('id', $id)->update($data);
        } else {
            return MerchantsAdmin::query()->insertGetId($data);
        }
    }
}
